package com.hmall.user.config;

import com.hmall.common.JacksonObjectMapper;
import com.hmall.user.filters.CommonInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

/**
 * @author HOLO
 * @create 2023-01-09 3:36
 * @discription
 */

/**
 * SpringMvc的组件配置
 */

@Slf4j
@Configuration
public class MvcConfig implements WebMvcConfigurer {

    /**
     * 添加拦截器
     *
     * @param registry r
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new CommonInterceptor()).addPathPatterns("/**");
    }


}
